﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PMS.ENT;
using PMS.DAL;

namespace PMS.BLL
{
    public class SemesterBLL
    {
        #region Get
        public static SemesterENT GetSemesterByID(int projectID)
        {
            try
            {
                return SemesterDAL.GetSemesterByID(projectID);
            }
            catch (Exception)
            {
                throw;
            }
        }

        public static SemesterENT GetSemesterByDate(DateTime date)
        {
            try
            {
                return SemesterDAL.GetSemesterByDate(date);
            }
            catch (Exception)
            {
                throw;
            }
        }

        public static SemesterCollection GetSemesterList(string semestername,string orderBy, string orderDirection, int page, int pageSize, out int totalRecords)
        {
            try
            {
                return SemesterDAL.GetSemesterList(semestername,orderBy, orderDirection, page, pageSize, out totalRecords);
            }
            catch (Exception)
            {
                throw;
            }
        }

        public static SemesterCollection GetSemesterListForCMB()
        {
            try
            {
                SemesterCollection listSemester = new SemesterCollection();
                listSemester.Add(new SemesterENT { SemesterID = 0, SemesterName = "--All--" });
                listSemester.AddRange(SemesterDAL.GetSemesterListForCMB());
                return listSemester;
            }
            catch (Exception)
            {

                throw;
            }
        }
        #endregion

        #region Insert Update Delete Semester


        public static int InsertSemester(SemesterENT Semester)
        {
            try
            {
                return SemesterDAL.InsertSemester(Semester);
            }
            catch (Exception)
            {

                throw;
            }
        }


        public static int UpdateSemester(SemesterENT semesterID)
        {
            try
            {
                return SemesterDAL.UpdateSemester(semesterID);
            }
            catch (Exception)
            {

                throw;
            }
        }

        public static int DeleteSemester(int SemesterID,int UserID)
        {
            try
            {
                return SemesterDAL.DeleteSemester(SemesterID, UserID);
            }
            catch (Exception)
            {

                throw;
            }
        }




        #endregion
    }
}
